package com.morningstar.config;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @className: MySelectImport
 * @description: 对ImportSelector接口的实现，实现后的类可通过全限定类名的方式批量选择多个类注入到Spring容器中
 * 它还可将spring.factories中的配置注入到Sprig容器中
 * @author: LiuZhenHe
 * @date: 2023/10/16 17:40
 **/
public class MySelectImport implements ImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        String[] beans = new String[]{
                "com/morningstar/service/UserService",
                "com/morningstar/entity/User"
        };
        return beans;
    }
}
